﻿<%@ Page Title="Bewerk Bands" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Bands.aspx.cs" Inherits="WebApplication2.EditPages.Bands" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1><%: Title %>.</h1>
                <h2>Groep16 - Festivalinfo</h2>
            </hgroup>
            <p>
                Hier kan je de gegevens van de tabel Bands bewerken.
            </p>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="band_id" DataSourceID="SqlDataSource1" AutoGenerateEditButton="True" AutoGenerateDeleteButton="True" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting">
                <Columns>
                    <asp:BoundField DataField="band_id" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="band_id" />
                    <asp:BoundField DataField="band_naam" HeaderText="naam" SortExpression="band_naam" />
                    <asp:BoundField DataField="band_soortMuziek" HeaderText="genre" SortExpression="band_soortMuziek" />
                    <asp:BoundField DataField="band_url" HeaderText="website" SortExpression="band_url" />
                </Columns>
     </asp:GridView>
     <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:groep16_festivalsConnectionString %>" SelectCommand="SELECT * FROM [bands]" DeleteCommand="DELETE FROM [bands] WHERE [band_id] = @band_id" InsertCommand="INSERT INTO [bands] ([band_naam], [band_soortMuziek], [band_url]) VALUES (@band_naam, @band_soortMuziek, @band_url)" UpdateCommand="UPDATE [bands] SET [band_naam] = @band_naam, [band_soortMuziek] = @band_soortMuziek, [band_url] = @band_url WHERE [band_id] = @band_id">
         <DeleteParameters>
             <asp:Parameter Name="band_id" Type="Int32" />
         </DeleteParameters>
         <InsertParameters>
             <asp:Parameter Name="band_naam" Type="String" />
             <asp:Parameter Name="band_soortMuziek" Type="String" />
             <asp:Parameter Name="band_url" Type="String" />
         </InsertParameters>
         <UpdateParameters>
             <asp:Parameter Name="band_naam" Type="String" />
             <asp:Parameter Name="band_soortMuziek" Type="String" />
             <asp:Parameter Name="band_url" Type="String" />
             <asp:Parameter Name="band_id" Type="Int32" />
         </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>